//
//  GoodsCollectionCell.m
//  LoveHappyShopping
//
//  Created by 白水非泉 on 16/6/24.
//  Copyright © 2016年 白水非泉. All rights reserved.
//

#import "GoodsCollectionCell.h"
#import "GoodsCollectionCellModel.h"
#import <UIImageView+WebCache.h>
@interface GoodsCollectionCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *now_priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *origin_priceLabel;
@property(nonatomic,strong)UIImage *placeHolderImg;
@end
@implementation GoodsCollectionCell
-(void)setModel:(GoodsCollectionCellModel *)model{
    _model=model;
    NSURL *url=[NSURL URLWithString:model.pic_url];
    [self.imgView sd_setImageWithURL:url placeholderImage:self.placeHolderImg];
    self.titleLabel.text=model.title;
    self.now_priceLabel.text=[NSString stringWithFormat:@"%g",model.now_price];
    NSString *origin=[NSString stringWithFormat:@"%g",model.origin_price];
    NSAttributedString *attrprice=[[NSAttributedString alloc]initWithString:origin attributes:@{NSStrikethroughColorAttributeName:[UIColor grayColor],NSStrikethroughStyleAttributeName:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle)}];
    self.origin_priceLabel.attributedText=attrprice;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.placeHolderImg=[UIImage imageNamed:@"94"];
    // Initialization code
}

@end
